<!--$Id: faq.so,v 10.22 2006/11/13 18:05:06 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: XA: Frequently Asked Questions</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a><a name="3"><!--meow--></a>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Distributed Transactions</dl></b></td>
<td align=right><a href="../xa/xa_config.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../apprec/intro.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>XA: Frequently Asked Questions</b></p>
<ol>
<p><li><b>Is it possible to mix XA and non-XA transactions?</b>
<p>Yes.  It is also possible for XA and non-XA transactions to coexist in
the same Berkeley DB environment.  To do this, specify the same environment
to the non-XA <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> calls as was specified in the Tuxedo
configuration file.</p>
<hr size=1 noshade>
<p><li><b>Does converting an application to run within XA change any of
the already existing C/C++ API calls it does?</b>
<p>When converting an application to run under XA, the application's Berkeley DB
calls are unchanged, with three exceptions:</p>
<ol>
<p><li>The application must specify the <a href="../../api_c/db_class.html#DB_XA_CREATE">DB_XA_CREATE</a> flag to
the <a href="../../api_c/db_class.html">db_create</a> function.
<p><li>Unless the application is performing an operation for a non-XA
transaction, the application should never explicitly call
<a href="../../api_c/txn_commit.html">DB_TXN-&gt;commit</a>, <a href="../../api_c/txn_abort.html">DB_TXN-&gt;abort</a> or <a href="../../api_c/txn_begin.html">DB_ENV-&gt;txn_begin</a>, and those
calls should be replaced by calls into the Tuxedo transaction manager.
<p><li>Unless the application is performing an operation for a non-XA
transaction, the application should specify a transaction argument of NULL
to Berkeley DB methods taking transaction arguments (for example, <a href="../../api_c/db_put.html">DB-&gt;put</a>
or <a href="../../api_c/db_cursor.html">DB-&gt;cursor</a>).
</ol>
<p>Otherwise, the application should be unchanged.</p>
<hr size=1 noshade>
<p><li><b>How does Berkeley DB recovery interact with recovery by the Tuxedo
transaction manager?</b>
<p>Recovery is completed in two steps.  First, each resource manager should
recover its environment(s).  This can be done via a program that calls
<a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> or by calling the <a href="../../utility/db_recover.html">db_recover</a> utility.  If
using the <a href="../../utility/db_recover.html">db_recover</a> utility, then the <b>-e</b> option
should be specified so that the regions that are recovered persist after
the utility exits.  Any transactions that were prepared, but neither
completed nor aborted, are restored to their prepared state so that they
may be aborted or committed via the Tuxedo recovery mechanisms.  After
each resource manager has recovered, then Tuxedo recovery may begin.
Tuxedo will interact with each resource manager via the __db_xa_recover
function which returns the list of prepared, but not yet completed
transactions. It should issue a commit or abort for each one, and only
after having completed each transaction will normal processing resume.</p>
<p>Finally, standard log file archival and catastrophic recovery procedures
should occur independently of XA operation.</p>
</ol>
<table width="100%"><tr><td><br></td><td align=right><a href="../xa/xa_config.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../apprec/intro.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>
